package com.liss.boot.contoller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@Controller
@RequestMapping("/hello")
public class HelloController {
    @RequestMapping("")
    public void hello( HttpServletResponse response) throws IOException {
        response.sendRedirect("https://www.baidu.com");
    }

    @GetMapping("/hello2")
    public String hello2(){
        return "hello2";
    }
}
